package com.quectel.core.module.scheduling.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.quectel.core.module.scheduling.entity.SchedulingAttendanceGroupEntity;
import com.quectel.core.module.scheduling.entity.SchedulingAttendanceGroupPersonBindingEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;
/**
 *
 * @author zhangheng
 * @email nolan.zhang@quectel.com
 * @date 2023/07/05 13:24
 */
public interface SchedulingAttendanceGroupPersonBindingDao extends BaseMapper<SchedulingAttendanceGroupPersonBindingEntity> {

    /**
     * 查询列表
     *
     * @param params
     * @return
     */
    List<SchedulingAttendanceGroupPersonBindingEntity> queryList(Map<String,Object> params);

    /**
     * 查询数量
     *
     * @param params
     * @return
     */
    int queryTotal(Map<String, Object> params);

    @Select("<script>select sag.* from scheduling_attendance_group_person_binding sagpb INNER JOIN scheduling_attendance_group sag on sagpb.scheduling_attendance_group_id = sag.id where sagpb.person_id = #{personId}" +
            "</script>")
    SchedulingAttendanceGroupEntity selectGroupByPersonId(@Param("personId") Long personId);
}
